package com.ita.acmsystem.merchant.validator.impl;

import com.ita.acmsystem.merchant.validator.IValidator;

public class MerchantNameValidatorImpl implements IValidator {
	
	private static final String MERCHANT_NAME_IS_NULL = "Merchant name can't be null!"; 
	private static final String MERCHANT_NAME_IS_BLANK = "Merchant name can't be blank!"; 
	private static final String MERCHANT_NAME_LENGTH_OVER_LIMIT = "Merchant name can't over 120!";

	@Override
	public String validate(String input) {
		String result = "";
		if (input == null) {
			result = MERCHANT_NAME_IS_NULL;
		} else if ("".equals(input)) {
			result = MERCHANT_NAME_IS_BLANK;
		} else if (input.length() > 120) {
			result = MERCHANT_NAME_LENGTH_OVER_LIMIT;
		}
		return result;
	}

}
